package cn.myjerry.sort.innerType;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class Demo03 {
	public static void main(String[] args) {
		String[] str = {"asd","ghu","dex","swz"};
		Utils.sort(str);//升序
		System.out.println(Arrays.toString(str));
		Date[] arr = new Date[3];
		arr[0] = new Date();
		arr[1] = new Date(System.currentTimeMillis()-1000*60*60);
		arr[2] = new Date(System.currentTimeMillis()+1000*60*60);
		Utils.sort(arr);
		System.out.println(Arrays.toString(arr));
		List<String> list = new ArrayList<String>();
		list.add("abc");
		list.add("add");
		list.add("asd");
		list.add("ace");
		Utils.sort(list, new StringComp());
		System.out.println(list.toString());
		
		System.out.println("=============================");
		
		String[] str2 = new String[]{"asdd","gh","deoox","swoz"};
		Utils.sort(str2, new StringComp());
		System.out.println(Arrays.toString(str2));
		
		
		System.out.println("==============================");
		List<String> list2 = new ArrayList<String>();
		list2.add("abc");
		list2.add("addf");
		list2.add("as");
		list2.add("acrre");
		Utils.sort(list2, new StringComp());
		System.out.println(list2.toString());
	}
}
